home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Macintosh Sample Code / SC.018.StdFile / StdFile.r < prev   
Encoding:
Text File  |  1994-11-18  |  23.4 KB  |  668 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    Standard File Sample Application
  6. #
  7. #    StdFile
  8. #
  9. #    StdFile.r    -    Rez Source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    
  15. #                1.00                04/89
  16. #                2.00                05/90
  17. #                2.01                06/92
  18. #
  19. #    Components:
  20. #                StdFile.p            April 1, 1989
  21. #                StdFile.h            April 1, 1988
  22. #                StdFile.r            April 1, 1988
  23. #                PStdFile.make        April 1, 1988
  24. ------------------------------------------------------------------------------*/
  25.  
  26. #include "Types.r"
  27. #include "SysTypes.r"
  28.  
  29. #include "StdFile.h"
  30.  
  31.  
  32. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  33.  
  34. /* These #defines are used to set enable/disable flags of a menu */
  35.  
  36. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  37. #define NoItems        0b0000000000000000000000000000000
  38. #define MenuItem1    0b0000000000000000000000000000001
  39. #define MenuItem2    0b0000000000000000000000000000010
  40. #define MenuItem3    0b0000000000000000000000000000100
  41. #define MenuItem4    0b0000000000000000000000000001000
  42. #define MenuItem5    0b0000000000000000000000000010000
  43. #define MenuItem6    0b0000000000000000000000000100000
  44. #define MenuItem7    0b0000000000000000000000001000000
  45. #define MenuItem8    0b0000000000000000000000010000000
  46. #define MenuItem9    0b0000000000000000000000100000000
  47. #define MenuItem10    0b0000000000000000000001000000000
  48. #define MenuItem11    0b0000000000000000000010000000000
  49. #define MenuItem12    0b0000000000000000000100000000000
  50. #define MenuItem13    0b0000000000000000001000000000000
  51. #define MenuItem14    0b0000000000000000010000000000000
  52. #define MenuItem15    0b0000000000000000100000000000000
  53. #define MenuItem16    0b0000000000000001000000000000000
  54. #define MenuItem17    0b0000000000000010000000000000000
  55. #define MenuItem18    0b0000000000000100000000000000000
  56. #define MenuItem19    0b0000000000001000000000000000000
  57. #define MenuItem20    0b0000000000010000000000000000000
  58. #define MenuItem21    0b0000000000100000000000000000000
  59. #define MenuItem22    0b0000000001000000000000000000000
  60. #define MenuItem23    0b0000000010000000000000000000000
  61. #define MenuItem24    0b0000000100000000000000000000000
  62. #define MenuItem25    0b0000001000000000000000000000000
  63. #define MenuItem26    0b0000010000000000000000000000000
  64. #define MenuItem27    0b0000100000000000000000000000000
  65. #define MenuItem28    0b0001000000000000000000000000000
  66. #define MenuItem29    0b0010000000000000000000000000000
  67. #define MenuItem30    0b0100000000000000000000000000000
  68. #define MenuItem31    0b1000000000000000000000000000000
  69.  
  70.  
  71.  
  72. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  73. // menu resources
  74.  
  75. resource 'MBAR' (rMenuBar, preload) {
  76.     {mApple, mFile, mEdit, mSFile};
  77. };
  78.  
  79. resource 'MENU' (mApple, "Apple", preload) {
  80.     mApple, textMenuProc, (AllItems & ~MenuItem2), enabled, apple,
  81.     {
  82.         "About " AppName "…", noicon, nokey, nomark, plain;
  83.         "-", noicon,    nokey, nomark, plain
  84.     }
  85. };
  86.  
  87. resource 'MENU' (mFile, "File", preload) { /* enable Quit only */
  88.     mFile, textMenuProc, (NoItems | MenuItem12), enabled, "File",
  89.     {
  90.         "New",            noicon, "N", nomark, plain;
  91.         "Open…",        noicon, "O", nomark, plain;
  92.         "-",            noicon, nokey, nomark, plain;
  93.         "Close",        noicon, "W", nomark, plain;
  94.         "Save",            noicon, "S", nomark, plain;
  95.         "Save As…",     noicon, nokey, nomark, plain;
  96.         "Revert",        noicon, nokey, nomark, plain;
  97.         "-",            noicon, nokey, nomark, plain;
  98.         "Page Setup…",    noicon, nokey, nomark, plain;
  99.         "Print…",        noicon, nokey, nomark, plain;
  100.         "-",            noicon, nokey, nomark, plain;
  101.         "Quit",            noicon, "Q", nomark, plain
  102.     }
  103. };
  104.  
  105. resource 'MENU' (mEdit, "Edit", preload) {
  106.     mEdit, textMenuProc, NoItems, enabled, "Edit",
  107.      {
  108.         "Undo",            noicon, "Z", nomark, plain;
  109.         "-",            noicon, nokey, nomark, plain;
  110.         "Cut",            noicon, "X", nomark, plain;
  111.         "Copy",            noicon, "C", nomark, plain;
  112.         "Paste",        noicon, "V", nomark, plain;
  113.         "Clear",        noicon, nokey, nomark, plain
  114.     }
  115. };
  116.  
  117. resource 'MENU' (mSFile, "Examples", preload) {
  118.     mSFile, textMenuProc, (AllItems), enabled, "Examples",
  119.      {
  120.         "Get Full Path…",                noicon, nokey, nomark, plain;
  121.         "PGetFile with Filter…",        noicon, nokey, nomark, plain;
  122.         "PGetFile with Complex Filter…",noicon, nokey, nomark, plain;
  123.         "PGet a directory…",            noicon, nokey, nomark, plain;
  124.         "PGet Multiple Files…",            noicon, nokey, nomark, plain;    
  125.         "-",                            noicon, nokey, nomark, plain;            
  126.         "PutFile…",                        noicon, nokey, nomark, plain;
  127.         "PPutFile with Format…",        noicon, nokey, nomark, plain;
  128.         "PutFile in System Folder…",    noicon, nokey, nomark, plain;
  129.         "PPutFile with List…",            noicon, nokey, nomark, plain;
  130.         "PPutFile with Options…",        noicon, nokey, nomark, plain;
  131.         "-",                            noicon, nokey, nomark, plain;            
  132.         "Idle time and Updates…",        noicon, nokey, nomark, plain;
  133.         "Remember File…",                noicon, nokey, nomark, plain;
  134.     }
  135. };
  136.  
  137.  
  138. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. // These are the resources used to create the bungle package used by the Finder.
  140.  
  141. type rAppSignature as 'STR ';
  142.  
  143. resource rAppSignature (rAppBundle, purgeable) {
  144.     "Sample Standard File Routines - Macintosh Developer Technical Support - v2.0"
  145. };
  146.  
  147. resource 'BNDL' (rAppBundle, purgeable) {
  148.     rAppSignature, 0, {'ICN#', {0, rAppIcon}, 'FREF', {0, rAppBundle}
  149.     }
  150. };
  151.  
  152. resource 'FREF' (rAppBundle, purgeable) {
  153.     'APPL', 0, ""
  154. };
  155.  
  156. resource 'ICN#' (rAppIcon, "App Icon", purgeable) {
  157.     {
  158. /* [1] */
  159.         $"0000 0000 0000 0000 FFFF FFFE 8000 0003"
  160.         $"83FE 0003 8202 1DFB 83FE 0003 8000 0003"
  161.         $"BFFF F1F3 A000 920B AEDE 920B A000 F1F3"
  162.         $"ADD4 9003 A000 91F3 AFB0 920B A000 920B"
  163.         $"ABEC 91F3 A000 9003 A000 F2AB A000 9003"
  164.         $"A000 91F3 BFFF F20B 8000 020B 8000 01F3"
  165.         $"BFFF F003 A000 11F3 ADEC 120B A000 120B"
  166.         $"BFFF F1F3 8000 0003 FFFF FFFF 7FFF FFFF",
  167. /* [2] */
  168.         $"0000 0000 0000 0000 FFFF FFFE FFFF FFFF"
  169.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  170.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  171.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  172.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  173.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  174.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  175.         $"FFFF FFFF FFFF FFFF FFFF FFFF 7FFF FFFF"
  176.     }
  177. };
  178.  
  179. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  180. resource 'vers' (1, purgeable) {
  181.     2, 0, beta, 3, verUs,
  182.     "2.0b3", "2.0b3, Copyright © 1989-90 Apple Developer Technical Support"
  183. };
  184.  
  185.  
  186. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  187. resource 'SIZE' (-1, purgeable) {
  188.     dontSaveScreen,
  189.     acceptSuspendResumeEvents,
  190.     enableOptionSwitch,
  191.     canBackground,                /* we can background, but we're not */
  192.     multiFinderAware,            /* we do our own activate/deactivate */
  193.     backgroundAndForeground,    /* this is not a background-only application! */
  194.     dontGetFrontClicks,            /* standard, don’t want front clicks */
  195.     ignoreChildDiedEvents,        /* I’m not a debugger and I don’t sub-launch */
  196.     is32BitCompatible,            /* this is a 32 bit clean application */
  197.     reserved, reserved, reserved, reserved,
  198.     reserved, reserved, reserved,
  199.     kPrefSize,
  200.     kMinSize
  201. };
  202.  
  203. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204. // misc strings used for misc reasons
  205.  
  206. resource 'STR#' (rStrMisc, "Misc Strings", purgeable) {
  207.      {
  208. /* [1] */    "K free";
  209. /* [2] */    "Select a Folder";
  210. /* [3] */    "The Cancel button.";
  211. /* [4] */    "Save As…";
  212. /* [5] */    " temp";            /* suffix to temporary file, includes a space */
  213. /* [6] */    "K on disk";
  214.     }
  215. };
  216.  
  217. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  218. // strings used to initializ the List Manager list of file types
  219.  
  220. resource 'STR#' (rStrList, "List Strings", purgeable) {
  221.     {
  222. /* [1] */    "Normal";
  223. /* [2] */    "Text";
  224. /* [3] */    "PICT";
  225. /* [4] */    "TIFF";
  226. /* [5] */    "ESPF";
  227.     }
  228. };
  229.  
  230. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  231. // this ALRT and DITL are used as an About screen
  232.  
  233. resource 'ALRT' (rAboutAlert, "About", purgeable) {
  234.     {0, 0, 136, 290}, rAboutAlert,
  235.     {
  236. /* [1] */     OK, visible, silent,
  237. /* [2] */     OK, visible, silent,
  238. /* [3] */     OK, visible, silent,
  239. /* [4] */     OK, visible, silent
  240.     }
  241. };
  242.  
  243. resource 'DITL' (rAboutAlert, "About", purgeable) {
  244.     {
  245. /* [1] */    {104, 180, 124, 260},    Button {enabled, "OK"},
  246. /* [2] */    {8, 8, 24, 262},        StaticText {disabled, "^0"},
  247. /* [3] */    {32, 8, 48, 65},        StaticText {disabled, "Version:"},
  248. /* [4] */    {32, 65, 64, 270},        StaticText {disabled, "^1"},
  249. /* [5] */     {72, 8, 88, 136},        StaticText {disabled, "Brought to you by:"},
  250. /* [6] */     {96, 24, 128, 167},        StaticText {disabled, "Apple Developer Technical Support"},
  251.     }
  252. };
  253.  
  254. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  255. // These are the resources used to display error messages to the user.
  256.  
  257. resource 'ALRT' (rUserAlert, "User Alert", purgeable) {
  258.     {0, 0, 129, 304}, rUserAlert,
  259.     {
  260. /* [1] */ OK, visible, silent,
  261. /* [2] */ OK, visible, silent,
  262. /* [3] */ OK, visible, silent,
  263. /* [4] */ OK, visible, silent
  264.     }
  265. };
  266.  
  267. resource 'DITL' (rUserAlert, "User Alert", purgeable) {
  268.     {
  269. /* [1] */ {104, 83, 121, 165},     Button        {enabled, "OK"},
  270. /* [2] */ {8, 72, 88, 296},     StaticText    {disabled, "^0  ^1"},
  271. /* [3] */ {10, 20, 42, 52},     Icon         {disabled, rCautionIcon}
  272.     }
  273. };
  274.  
  275. // These are the strings used for error messages.
  276. resource 'STR#' (rErrStrings, purgeable) {
  277.     {
  278. /* [1] */ "An error has occurred.";
  279. /* [2] */ "A Memory Manager error has occurred.";
  280. /* [3] */ "A Resource Manager error has occurred.";
  281. /* [4] */ "Memory is too low to continue.  Try increasing the SIZE resource.";
  282. /* [5] */ "Could not find application's menu resources.";
  283. /* [6] */ "A File System error has occurred.";
  284. /* [7] */ "The file to be remembered has been lost, please select another file.";
  285. /* [8] */ "Requires A/UX version 2.0 or later.";
  286. /* [9] */ "Requires a System with the enhanced ROMs, such as the 512Ke"
  287.     }
  288. };
  289.  
  290. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  291. // These are the resources used for an emergency exit alert.
  292.  
  293. resource 'ALRT' (rExitAlert, "Exit Alert", purgeable) {
  294.     {0, 0, 129, 248}, rExitAlert,
  295.     {
  296. /* [1] */ OK, visible, silent,
  297. /* [2] */ OK, visible, silent,
  298. /* [3] */ OK, visible, silent,
  299. /* [4] */ OK, visible, silent
  300.     }
  301. };
  302.  
  303. resource 'DITL' (rExitAlert, "Exit Alert", purgeable) {
  304.     {
  305. /* [1] */ {104, 83, 121, 165},    Button        {enabled, "OK"},
  306. /* [2] */ {10, 20, 42, 52},        Icon        {disabled, rCautionIcon},
  307. /* [3] */ {8, 72, 40, 240},        StaticText    {disabled, "Sorry, an unrecoverable error has occurred!"},
  308. /* [4] */ {48, 8, 96, 240},        StaticText    {disabled, "^0"}
  309.     }
  310. };
  311.  
  312.  
  313. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  314. // alert used to display some file info when we've found a file
  315.  
  316. resource 'ALRT' (rFInfoAlert, "Found File", purgeable) {
  317.     {40, 40, 188, 354}, rFInfoAlert,
  318.     {
  319.         /* [1] */ OK, visible, sound1,
  320.         /* [2] */ OK, visible, sound1,
  321.         /* [3] */ OK, visible, sound1,
  322.         /* [4] */ OK, visible, sound1
  323.     }
  324. };
  325.  
  326. resource 'DITL' (rFInfoAlert, purgeable) {
  327.     {
  328. /* [1] */ {112, 224, 132, 284}, Button {enabled, "OK"},
  329. /* [2] */ {56, 8, 104, 288}, StaticText {disabled, "File Name: “^0”\nModification date: ^1"},
  330. /* [3] */ {8, 56, 40, 288},    StaticText {disabled, "The following file has been found."},
  331. /* [4] */ {8, 8, 40, 40},    Icon {disabled, 1}
  332.     }
  333. };
  334.  
  335. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  336. // alert used to show the selection made from Std File
  337.  
  338. resource 'ALRT' (rShowSelectionAlert, "Show Selection", purgeable) {
  339.     {42, 42, 214, 406}, rShowSelectionAlert,
  340.     {
  341. /* [1] */ OK, visible, silent,
  342. /* [2] */ OK, visible, silent,
  343. /* [3] */ OK, visible, silent,
  344. /* [4] */ OK, visible, silent
  345.     }
  346. };
  347.  
  348. resource 'DITL' (rShowSelectionAlert, "Show Selection", purgeable) {
  349.     {
  350. /* [1] */ {144, 272, 164, 332},    Button        {enabled, "OK"},
  351. /* [2] */ {32, 64, 136, 344},    StaticText    {disabled, "“^0”"},
  352. /* [3] */ {8, 64, 24, 224},        StaticText    {disabled, "The item selected was:"},
  353. /* [4] */ {10, 20, 42, 52},        Icon        {disabled, rNoteIcon},
  354. /* [5] */ {144, 8, 168, 248},    StaticText     {disabled, "^1"}
  355.     }
  356. };
  357.  
  358. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  359. // a copy of the real Standard GetFile Dialog
  360.  
  361. resource 'DLOG' (kGetFileDLOG, "Std Get File", purgeable) {
  362.     {0, 0, 200, 348}, dBoxProc, invisible, noGoAway, 0x0, kGetFileDLOG, ""
  363. };
  364.  
  365. resource 'DITL' (kGetFileDLOG, "Std Get File", purgeable) {
  366.     {
  367. /* [1] */    {138, 256, 156, 336},    Button        {enabled,"Open"},
  368. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"},
  369. /* [3] */    {163, 256, 181, 336},    Button        {enabled,"Cancel"},
  370. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},
  371. /* [5] */    {68, 256, 86, 336},        Button        {enabled,"Eject"},
  372. /* [6] */    {93, 256, 111, 336},    Button        {enabled,"Drive"},
  373. /* [7] */    {39, 12, 185, 230},        UserItem    {enabled},
  374. /* [8] */    {39, 229, 185, 246},    UserItem    {enabled},
  375. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},
  376. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""}
  377.     }
  378. };
  379.  
  380.  
  381. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  382. // a copy of the real of Standard PutFile Dialog
  383.  
  384. resource 'DLOG' (kPutFileDLOG, "Std Put File", purgeable) {
  385.     {0, 0, 184, 304}, dBoxProc, invisible, noGoAway, 0x0, kPutFileDLOG, ""
  386. };
  387.  
  388. resource 'DITL' (kPutFileDLOG, "Std Put File", purgeable) {
  389.     {
  390. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  391. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  392. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  393. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  394. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  395. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  396. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  397. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled}
  398.     }
  399. };
  400.  
  401.  
  402. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  403. // used in SFGetFile with a multi-file list
  404.  
  405. resource 'DLOG' (rListGetDLOG, "Multi Get File", purgeable) {
  406.     {40, 40, 324, 398}, dBoxProc, invisible, noGoAway, 0x0, rListGetDLOG, ""
  407. };
  408.  
  409. resource 'DITL' (rListGetDLOG, "Multi Get File", purgeable) {
  410.     {
  411. /* [1] */    {216, 256, 234, 336},    Button        {enabled, "Add"},
  412. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled, ""},
  413. /* [3] */    {163, 256, 181, 336},    Button        {enabled, "Cancel"},
  414. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},
  415. /* [5] */    {68, 256, 86, 336},        Button        {enabled, "Eject"},
  416. /* [6] */    {93, 256, 111, 336},    Button        {enabled, "Drive"},
  417. /* [7] */    {39, 12, 185, 230},        UserItem    {enabled},
  418. /* [8] */    {39, 229, 185, 246},    UserItem    {enabled},
  419. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},
  420. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled, ""},
  421. /* [11] */    {202, 12, 280, 230},    UserItem    {disabled},
  422. /* [12] */    {138, 256, 156, 336},    Button        {enabled, "Open"},
  423. /* [13] */    {241, 256, 259, 336},    Button        {enabled, "Remove"}
  424.     }
  425. };
  426.  
  427. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  428. // Used for custom SFPGetFile having a filter controlled by some buttons
  429.  
  430. resource 'DLOG' (rSFPGetFileDLOG, "Custom Get File", purgeable) {
  431.     {0, 0, 200, 349}, dBoxProc, invisible, noGoAway, 0x0, rSFPGetFileDLOG, ""
  432. };
  433.  
  434. resource 'DITL' (rSFPGetFileDLOG, "Custom Get File", purgeable) {
  435.     {
  436. /* [1] */    {138, 256, 156, 336},    Button        {enabled,"Open"};
  437. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"};
  438. /* [3] */    {163, 256, 181, 336},    Button        {enabled,"Cancel"};
  439. /* [4] */    {39, 252, 59, 347},        UserItem    {disabled};
  440. /* [5] */    {68, 256, 86, 336},        Button        {enabled,"Eject"};
  441. /* [6] */    {93, 256, 111, 336},    Button        {enabled,"Drive"};
  442. /* [7] */    {39, 12, 180, 230},        UserItem    {enabled};
  443. /* [8] */    {39, 229, 180, 245},    UserItem    {enabled};
  444. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled};
  445. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""};
  446. /* [11] */    {1, 14, 20, 142},        RadioButton    {enabled,"Text files only"};
  447. /* [12] */    {19, 14, 38, 176},        RadioButton    {enabled,"Applications only"};
  448.     }
  449. };
  450.  
  451.  
  452. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  453. // Used for custom SFPPutFile that displays the free space, and controls
  454. // which files to be viewed
  455.  
  456. resource 'DLOG' (rSFPPutFileDLOG, "Custom Put File", purgeable) {
  457.     {0, 0, 164, 304}, dBoxProc, invisible, noGoAway, 0x0, rSFPPutFileDLOG, ""
  458. };
  459.  
  460. resource 'DITL' (rSFPPutFileDLOG, "Custom Put File", purgeable) {
  461.      {
  462. /* [1] */    {74, 12, 92, 82},        Button        {enabled,"Save"};
  463. /* [2] */    {74, 114, 92, 184},        Button        {enabled,"Cancel"};
  464. /* [3] */    {12, 12, 28, 184},        StaticText    {disabled,"Save as:"};
  465. /* [4] */    {16, 209, 34, 295},        UserItem    {disabled};
  466. /* [5] */    {74, 217, 92, 287},        Button        {enabled,"Eject"};
  467. /* [6] */    {101, 217, 119, 287},    Button        {enabled,"Drive"};
  468. /* [7] */    {34, 14, 50, 182},        EditText    {enabled,""};
  469. /* [8] */    {16, 200, 88, 201},        UserItem    {disabled};
  470. /* [9] */    {102, 11, 122, 108},    RadioButton    {enabled,"Normal"};
  471. /* [10] */    {129, 11, 149, 108},    RadioButton {enabled,"Text Only"};
  472. /* [11] */    {37, 202, 73, 303},        UserItem    {disabled}
  473.     }
  474. };
  475.  
  476.  
  477. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  478. // Used for Get Directory
  479.  
  480. resource 'DLOG' (rGetDirectoryDLOG, "Get Directory", purgeable) {
  481.     {0, 0, 217, 348}, dBoxProc, invisible, noGoAway, 0x0, rGetDirectoryDLOG, ""
  482. };
  483.  
  484. resource 'DITL' (rGetDirectoryDLOG, "Get Directory", purgeable) {
  485.     {
  486. /* [1] */    {142, 256, 160, 336},    Button        {enabled,"Open"},
  487. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"},
  488. /* [3] */    {193, 256, 211, 336},    Button        {enabled,"Cancel"},
  489. /* [4] */    {43, 232, 63, 347},        UserItem    {disabled},
  490. /* [5] */    {72, 256, 90, 336},        Button        {enabled,"Eject"},
  491. /* [6] */    {97, 256, 115, 336},    Button        {enabled,"Drive"},
  492. /* [7] */    {43, 12, 189, 230},        UserItem    {enabled},
  493. /* [8] */    {43, 229, 189, 246},    UserItem    {enabled},
  494. /* [9] */    {128, 252, 129, 340},    UserItem    {disabled},
  495. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""},
  496. /* [11] */    {167, 256, 185, 336},    Button        {enabled,"Directory"},
  497. /* [12] */    {0, 30, 18, 215},        Button        {enabled,"Select Current Directory:"},
  498. /* [13] */    {200, 20, 1145, 136},    StaticText    {disabled,""}
  499.     }
  500. };
  501.  
  502.  
  503. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  504. // used in PPutFile to display a list containing a set of file types
  505.  
  506. resource 'DLOG' (rPutListsFileDLOG, "List In Put", purgeable) {
  507.     {0, 0, 262, 304}, dBoxProc, invisible, noGoAway, 0x0, rPutListsFileDLOG, ""
  508. };
  509.  
  510. resource 'DITL' (rPutListsFileDLOG, "List In Put", purgeable) {
  511.     {
  512. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  513. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  514. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  515. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  516. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  517. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  518. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  519. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled},
  520. /* [9] */    {185, 14, 257, 150},    UserItem    {disabled}
  521.     }
  522. };
  523.  
  524.  
  525. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  526. // used in PPutFile to install an option button which brings up an additional
  527. // dialog containing a set of file types
  528.  
  529. resource 'DLOG' (rOptionsDLOG, "Options Put", purgeable) {
  530.     {0, 0, 214, 304}, dBoxProc, invisible, noGoAway, 0x0, rOptionsDLOG, ""
  531. };
  532.  
  533. resource 'DITL' (rOptionsDLOG, "Options Put", purgeable) {
  534.     {
  535. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  536. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  537. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  538. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  539. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  540. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  541. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  542. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled},
  543. /* [9] */    {184, 218, 202, 288},    Button        {enabled,"Options…"},
  544. /* [10] */    {184, 14, 202, 197},    StaticText    {disabled,"ZowiePaint"},
  545.     }
  546. };
  547.  
  548.  
  549. resource 'DLOG' (rOptionsSubDLOG, "Options Sub-Dialog", purgeable) {
  550.     {40, 40, 184, 306}, dBoxProc, visible, noGoAway, 0x0, rOptionsSubDLOG, ""
  551. };
  552.  
  553. resource 'DITL' (rOptionsSubDLOG, "Options Sub-Dialog", purgeable) {
  554.     {
  555. /* [1] */    {112, 176, 132, 236},    Button        {enabled,"OK"},
  556. /* [2] */    {112, 96, 132, 156},    Button        {enabled,"Cancel"},
  557. /* [3] */    {40, 24, 56, 120},        RadioButton    {enabled,"ZowiePaint"},
  558. /* [4] */    {56, 24, 72, 120},        RadioButton    {enabled,"PICT2"},
  559. /* [5] */    {72, 24, 88, 120},        RadioButton    {enabled,"PICT"},
  560. /* [6] */    {40, 144, 56, 240},        RadioButton    {enabled,"MacPaint"},
  561. /* [7] */    {72, 144, 88, 240},        RadioButton    {enabled,"TIFF"},
  562. /* [8] */    {56, 144, 72, 240},        RadioButton    {enabled,"PixelPaint"},
  563. /* [9] */    {24, 16, 96, 248},        UserItem    {disabled},
  564. /* [10] */    {16, 32, 36, 92},        StaticText    {disabled,"Formats"}
  565.     }
  566. };
  567.  
  568. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  569. // used in PGetFile to demonstrate idle time.  It contains some statText items
  570. // which are updated during the idle events.  In addition, a window is created
  571. // in the background which is asking for update events. 
  572.  
  573. resource 'DLOG' (rGetIdleUpdates, "Idle Updates", purgeable) {
  574.     {0, 0, 232, 348}, dBoxProc, invisible, noGoAway, 0x0, rGetIdleUpdates, ""
  575. };
  576.  
  577. resource 'DITL' (rGetIdleUpdates, "Idle Updates", purgeable) {
  578.     {
  579. /* [1] */    {138, 256, 156, 336},    Button        {enabled, "Open"},
  580. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled, "Hidden"},
  581. /* [3] */    {163, 256, 181, 336},    Button        {enabled, "Cancel"},
  582. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},
  583. /* [5] */    {68, 256, 86, 336},        Button        {enabled, "Eject"},
  584. /* [6] */    {93, 256, 111, 336},    Button        {enabled, "Drive"},
  585. /* [7] */    {39, 12, 185, 230},        UserItem    {enabled},
  586. /* [8] */    {39, 229, 185, 246},    UserItem    {enabled},
  587. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},
  588. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled, ""},
  589. /* [11] */    {16, 248, 32, 344},        StaticText    {disabled, ""},
  590. /* [12] */    {200, 12, 220, 344},    StaticText    {disabled, ""}
  591.     }
  592. };
  593.  
  594. resource 'WIND' (rUpdateWindow, "Update Window", purgeable) {
  595.     {45, 20, 236, 340}, documentProc, visible, noGoAway, 0x0, "Window needing updates"
  596. };
  597.  
  598.  
  599. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  600. // The animated cursor resource used in the MPW CursorCtl unit is not
  601. // defined by MPW.  So, I’ve created the type for it.
  602. // These are the resources used for the animated cursors.  They are preloaded
  603. // and non-purgeable to help reduce memory fragmentation.
  604.  
  605.  
  606. //type 'acur' {
  607. //    integer = $$Countof(AcursArray);    /*Number of cursors (“frames of film”)*/
  608. //    fill word;                            /*Next frame to show <for internal use>*/
  609. //    wide array AcursArray {
  610. //        integer;                        /*'CURS' resource id for frame #1*/
  611. //        fill word;                        /*<for internal use>*/
  612. //    };
  613. //};
  614.  
  615. resource 'acur' (0, preload, nonPurgeable) {
  616.     {
  617.     rACursor1, rACursor2, rACursor3, rACursor4
  618.     }
  619. };
  620.  
  621. resource 'CURS' (rACursor1, preload, nonPurgeable) {
  622.     $"00 00 00 00 00 00 16 00 3E 01 54 03 C3 05 F3 FD"
  623.     $"08 FA 0C 72 0C 02 0D F2 0A 0A 0A 0A 0A 0A 1C 1E",
  624.     $"00 00 00 00 00 00 16 00 3E 01 7C 03 FF 07 FF FF"
  625.     $"0F FE 0F FE 0F FE 0F FE 0E 0E 0E 0E 0E 0E 1C 1E",
  626.     {4, 10}
  627. };
  628.  
  629. resource 'CURS' (rACursor2, preload, nonPurgeable) {
  630.     $"30 30 28 38 24 24 13 AC 0B C6 04 0C 02 36 02 36"
  631.     $"02 E0 02 E0 0E E0 10 60 26 20 29 90 28 50 30 38",
  632.     $"30 30 38 38 3C 3C 1F BC 0F FE 07 FC 03 F6 03 F6"
  633.     $"03 E0 03 E0 0F E0 1F E0 3F E0 39 F0 38 70 30 38",
  634.     {15, 7}
  635. };
  636.  
  637. resource 'CURS' (rACursor3, preload, nonPurgeable) {
  638.     $"00 00 06 C0 0A A0 12 90 14 58 17 D8 20 18 27 18"
  639.     $"4F 18 9F CF E0 C3 80 2A 00 FC 00 D0",
  640.     $"00 00 06 C0 0E E0 1E F0 1C 78 1F F8 3F F8 3F F8"
  641.     $"7F F8 FF FF E0 FF 80 3E 00 FC 00 D0",
  642.     {9, 6}
  643. };
  644.  
  645. resource 'CURS' (rACursor4, preload, nonPurgeable) {
  646.     $"0E 06 05 0A 04 CA 02 32 03 04 03 B8 03 A0 03 A0"
  647.     $"36 20 36 20 18 10 31 E8 1A E4 12 12 0E 0A 06 06",
  648.     $"0E 06 07 0E 07 CE 03 FE 03 FC 03 F8 03 E0 03 E0"
  649.     $"37 E0 37 E0 1F F0 3F F8 1E FC 1E 1E 0E 0E 06 06",
  650.     {6, 6}
  651. };
  652.  
  653.  
  654. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  655. // I've created custom a template and resource to remember a file.
  656.  
  657. type 'FILE' {
  658.     hex string [28];                    /*volume name (27 chars)*/
  659.     unsigned longint;                    /*dirID is a LongInt*/
  660.     hex string [64];                    /*file name (63 chars)*/
  661. };
  662.  
  663.  
  664. resource 'FILE' (rMemorizedFile, purgeable) {"", 0, ""};
  665.  
  666.  
  667.  
  668.